# -*- coding: utf-8 -*-

'''
import gtk.gdk
from Simulinux.partlibrary import partlib
from Simulinux.diagram import MODE_NORMAL, MODE_REGION, MODE_MOVE
from Simulinux.diagram import MODE_PIN, MODE_CONNECTION
from Simulinux.EventHandler.mode_normal import ModeNormalEventHandler
from Simulinux.EventHandler.mode_region import ModeRegionEventHandler
from Simulinux.EventHandler.mode_move import ModeMoveEventHandler
from Simulinux.EventHandler.mode_pin import ModePinEventHandler
from Simulinux.EventHandler.mode_connection import ModeConnectionEventHandler
from Simulinux.net import Net
'''

#@todo: Substituir self.__diagram.selection por tad lista sem repetição
#@todo: Fazer diagramas de sequência para os eventos

class EventHandler:
    pass

    '''def __init__(self, diagram, gui):
        self.__diagram = diagram
        self.__gui = gui
        self.__position_backup = {}
        self.__last_valid_position = {}
        self.__pin = () #pin, block posx, block posy
        self.__new_net = None
        self.__mode_normal = ModeNormalEventHandler(self, diagram, gui)
        self.__mode_region = ModeRegionEventHandler(self, diagram, gui)
        self.__mode_move = ModeMoveEventHandler(self, diagram, gui)
        self.__mode_pin = ModePinEventHandler(self, diagram, gui)
        self.__mode_connection = ModeConnectionEventHandler(self, diagram, gui)
        self.__dispatcher = {
            MODE_NORMAL: self.__mode_normal,
            MODE_REGION: self.__mode_region,
            MODE_MOVE: self.__mode_move,
            MODE_PIN: self.__mode_pin,
            MODE_CONNECTION: self.__mode_connection
        }'''
        
    '''#Services for the ModeHandlers
    
    def set_backup_position(self, block, x, y):
        self.__position_backup[block] = (x, y)
    
    def get_backup_position(self, block):
        return self.__position_backup[block]
    
    def clear_backup_position(self):
        self.__position_backup = {}
        
    def set_last_valid_position(self, block, x, y):
        self.__last_valid_position[block] = (x, y)
        
    def get_last_valid_position(self, block):
        return self.__last_valid_position[block]
    
    def set_pin(self, pin, blockx, blocky):
        self.__pin = (pin, blockx, blocky)
    
    def get_pin(self):
        return self.__pin
    
    def clear_pin(self):
        self.__pin = None'''
